<?php


namespace app\api\validate;


use think\Validate;

class UserLogin extends Validate
{
    protected $regex = [ 'password' => '^((?=.*?\d)(?=.*?[A-Za-z])|(?=.*?\d)(?=.*?[~!@#$%^&*()_+`\-={}:";\'<>,.\/?])|(?=.*?[A-Za-z])(?=.*?[~!@#$%^&*()_+`\-={}:";\'<>,.\/?]))[\dA-Za-z~!@#$%^&*()_+`\-={}:";\'<>,.\/?]+$'];

    protected $rule = [
        'username' => 'require|mobile|number|length:11',
        'password' => 'require|length:6,20|regex:password',
    ];

    protected $message  =   [
        'username.require' => '手机号码必须输入',
        'username.number'     => '手机号码只能是数字',
        'password.require'   => '密码必须填写',
        'password.length'   => '密码必须6-20个字符',
        'password.regex' => '密码必须是字母数字符号两种形式以上的组合',
    ];

}